{% extends 'shop/base.html' %}

{% block content%}
	<table class="cart">
		<tr>
			<th>Image</th>
			<th>Product</th>
			<th>Quantity</th>
			<th>Remove</th>
			<th>Price</th>
			<th>Unit Price</th>
		</tr>
		{% for item in cart%}
		{% with product = item.product %}
		<tr>
			<td>
				<a href="{{product.get_absolute_url}}">
					![]{% if product.image%}{{product.image.url}}{% endif%}
				</a>
			</td>
			<td>{{product.name}}</td>
			<td>{{item.quantity}}</td>
			<td><a href="{% url "cart:cart_remove" product.id %}"></a></td>
			<td>${{item.price}}</td>
			<td class="num">{{item.total_price}}</td>
		</tr>
		{% endwith %}
		<tr class="total">
			<td>Total</td>
			<td colspan="4"></td>
			<td class="num">${{cart.get_total_price}}</td>
		</tr>
	</table>
	<p class="text-right">
		<a href="{% url "shop:product_list" %}" class="button light">Continue shopping</a>
		<a class="button" href="#">Checkout</a>
	</p>
{% endblock %}